#! /bin/bash
dt=`date +'%Y-%m-%d'`
arr=(AML_ACCOUNT_MASTER)

for i in ${arr[@]} 
do
sqoop import	\
--connect jdbc:oracle:thin:192.168.65.15:1521:orcl	\
--username AML \
--password 123456	\
--table $arr \
--hcatalog-database ods \
--hcatealog-table ODS_$arr \
--hive-partition-key etl_date \
--hive-partition-value $dt \
--fields-terminated-by '\t' \
--verbose \
-m 1
done;


#! /bin/bash
dt=`date +"%Y-%m-%d"`
arr=(AML_ALERT AML_CUSTOMER_MASTER AML_MONITORING_RULE AML_SCREENING_RESULT AML_SUSPICIOUS_TXN_REPORT AML_TRANSACTION_DETAIL AML_UBO_INFO AML_WATCHLIST_DETAIL)
yt=`date -d "-1 days" "+%Y%m%d"`
for i in ${arr[@]}
do
sqoop import    \
--connect jdbc:oracle:thin:@192.168.65.15:1521:orcl \
--username AML \
--password 123456 \
--table $i \
--where 'create_date=$yt' \
--hcatalog-database ods \
--hcatalog-table ODS_$i \
--hive-partition-key etl_date \
--hive-partition-value $dt \
--fields-terminated-by '\t' \
--verbose \
-m 1
done

#! /bin/bash
dt=`date +"%Y-%m-%d"`
arr=(AML_WATCHLIST_MASTER)
yt=`date -d "-1 days" "+%Y%m%d"`
for i in ${arr[@]}
do
sqoop import    \
--connect jdbc:oracle:thin:@192.168.65.15:1521:orcl \
--username AML \
--password 123456 \
--table $i \
--hcatalog-database ods \
--hcatalog-table ODS_$i \
--hive-overwrite \
--hive-partition-key etl_date \
--hive-partition-value $dt \
--fields-terminated-by '\t' \
--verbose \
-m 1
done